<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Welcome to Zhuang's Web</title>
  <style>
    /* 设置页面背景为黑色 */
    body {
      margin: 0;
      padding: 0;
      background-color: black;
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh;
      overflow: hidden;
      font-family: 'Microsoft YaHei', sans-serif;
      position: relative;
      flex-direction: column; /* 让页面内容垂直排列 */
    }

    /* 设置炫动效果 */
    @keyframes move {
      0% { transform: translateY(-50px); opacity: 0; }
      50% { transform: translateY(0); opacity: 1; }
      100% { transform: translateY(50px); opacity: 0; }
    }

    /* 内容的样式 */
    .content {
      font-size: 48px;
      font-weight: bold;
      color: white;
      animation: move 2s infinite;
      position: absolute;
      z-index: 10;
      top: 10%;  /* 将文字向上移动 */
    }

    /* 流星的样式 */
    .meteor {
      position: absolute;
      top: -10px;
      width: 3px;
      height: 15px;
      opacity: 0.8;
      animation: fall 1.5s linear infinite;
    }

    /* 流星掉落的动画 */
    @keyframes fall {
      to {
        transform: translateY(100vh) translateX(50px);
        opacity: 0;
      }
    }

    /* 表单的样式 */
    .form-container {
      margin-top: 100px; /* 设置表单距离标题的间距 */
      text-align: center;
      z-index: 10;
    }

    .form-container input {
      margin: 10px 0;
      padding: 10px;
      width: 200px;
      font-size: 16px;
      border-radius: 5px;
      border: 1px solid #ccc;
    }

    .form-container button {
      padding: 10px 20px;
      font-size: 16px;
      background-color: #4CAF50;
      color: white;
      border: none;
      border-radius: 5px;
      cursor: pointer;
    }

    .form-container button:hover {
      background-color: #45a049;
    }

  </style>
</head>
<body>
  <div class="content">
    Welcome to Zhuang's Web
  </div>

  <!-- 表单部分 -->
  <div class="form-container">
    <form action="/login" method="post">
      <div>
        <label for="username" style="color:white; font-size: 18px;">Username:</label>
        <input type="text" id="username" name="username" required>
      </div>
      <div>
        <label for="password" style="color:white; font-size: 18px;">Password:</label>
        <input type="password" id="password" name="password" required>
      </div>
      <div>
        <button type="submit">Login</button>
      </div>
    </form>
  </div>

  <!-- 流星雨效果 -->
  <script>
    // 随机颜色生成函数
    function randomColor() {
      const colors = ['#FF6347', '#32CD32', '#1E90FF', '#FFD700', '#FF69B4', '#8A2BE2', '#00FA9A', '#FF4500'];
      return colors[Math.floor(Math.random() * colors.length)];
    }

    // 生成多个流星
    function createMeteor() {
      for (let i = 0; i < 100; i++) {
        let meteor = document.createElement('div');
        meteor.classList.add('meteor');
        
        // 随机设置流星的颜色
        meteor.style.backgroundColor = randomColor();
        
        // 随机设置流星初始位置
        meteor.style.left = `${Math.random() * 100}vw`;
        
        // 将流星添加到页面
        document.body.appendChild(meteor);
        
        // 为每个流星设置不同的下落动画延迟和速度
        meteor.style.animationDuration = `${Math.random() * 2 + 1}s`;  // 随机持续时间
        meteor.style.animationDelay = `${Math.random() * 3}s`;  // 随机延迟
      }
    }

    // 调用生成流星的函数
    createMeteor();
  </script>
</body>
</html>
